package sc.test.spring.aware;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

import sc.prototype.common.ConsoleUtil;

@Component
public class AwareBean implements ApplicationListener<ContextRefreshedEvent>, ConsoleUtil {


    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        ApplicationContext context = event.getApplicationContext();
        Console.info("AwareBean: {}", context.getBeansOfType(SomeInterface.class));
    }
}
